package com.bw.liveplay.common.mvvm.adapter

import android.widget.ImageView
import android.widget.TextView
import com.bw.liveplay.R
import com.bw.liveplay.common.entity.ComFeedEntity
import com.bw.liveplay.common.network.LoadImage
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * @author KK
 * @description:
 * @date :2021/11/13 10:01
 *
 */
class CommentAdapter : BaseQuickAdapter<ComFeedEntity, BaseViewHolder>(R.layout.item_comment) {

    override fun convert(holder: BaseViewHolder, item: ComFeedEntity) {

        var img = holder.getView<ImageView>(R.id.item_comment_img)
        var name = holder.getView<TextView>(R.id.item_comment_name)
        var text = holder.getView<TextView>(R.id.item_comment_text)
        var avatar = item.author!!.avatar
        if (avatar != null) {
            LoadImage.loadcrile(avatar,img)
        }
        name.text = item!!.author!!.name
        text.text = item.commentText



    }
}